from sklearn.preprocessing import LabelEncoder
import numpy as np

x=['a','b','a','b','a','c']

le=LabelEncoder()

x=le.fit_transform(x)
print(le.classes_)
print(x)